package com.wanshi.controller;

import com.wanshi.entity.Cust;
import com.wanshi.service.ICustService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//huxintong
@RestController
@RequestMapping("/zhen")
public class lemonController {

    @Autowired
    private ICustService custService;

    @DeleteMapping("/{id}")
    public String delById(@PathVariable String id){
        if (custService.removeById(id)) {
            return "删除成功";
        }else {
            return "删除失败";
        }
    }

    @GetMapping("/{id}")
    public Cust findById(@PathVariable String id){
        return custService.getById(id);
    }

}
